package cn.boge.hrm.domain;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;

import javax.validation.constraints.NotEmpty;
import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author boge
 * @since 2022-04-06
 */
@TableName("t_login_user")
public class LoginUser extends Model<LoginUser> {

    //后台用户
    public static final int USER_TYPE_SYS = 0 ;
    //前台用户
    public static final int USER_TYPE_WEB = 1 ;

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    @NotEmpty(message = "不可为空")
    private String username;
    @NotEmpty(message = "不可为空")
    private String password;
    private Integer type;

    @TableField("tenant_name")
    private String tenantName;

    @TableField("tenant_id")
    private Long tenantId;

    public String getTenantName() {
        return tenantName;
    }

    public void setTenantName(String tenantName) {
        this.tenantName = tenantName;
    }

    public Long getTenantId() {
        return tenantId;
    }

    public void setTenantId(Long tenantId) {
        this.tenantId = tenantId;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "LoginUser{" +
                ", id=" + id +
                ", username=" + username +
                ", password=" + password +
                ", type=" + type +
                "}";
    }
}
